:root {
  /* Apple系统字体 */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  /* Apple风格色彩方案 */
  color: #1c1c1e;
  background-color: #f5f5f7;

  /* 字体渲染优化 */
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;

  /* Apple设计变量 */
  --apple-blue: #007aff;
  --apple-green: #34c759;
  --apple-yellow: #ffcc00;
  --apple-red: #ff3b30;
  --apple-orange: #ff9500;
  --apple-purple: #af52de;
  --apple-gray-1: #f5f5f7;
  --apple-gray-2: #e5e5ea;
  --apple-gray-3: #d1d1d6;
  --apple-gray-4: #c7c7cc;
  --apple-gray-5: #aeaeb2;
  --apple-gray-6: #8e8e93;
  --apple-gray-7: #636366;
  --apple-gray-8: #3a3a3c;
  --apple-gray-9: #1c1c1e;
  --apple-white: #ffffff;
  --apple-black: #000000;

  /* 圆角大小 */
  --apple-radius-small: 6px;
  --apple-radius-medium: 8px;
  --apple-radius-large: 12px;
  --apple-radius-xl: 16px;
  --apple-radius-full: 9999px;

  /* 阴影 */
  --apple-shadow-small: 0 1px 2px rgba(0, 0, 0, 0.05);
  --apple-shadow-medium: 0 2px 8px rgba(0, 0, 0, 0.08);
  --apple-shadow-large: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* 过渡动画 */
  --apple-transition-fast: 0.15s ease;
  --apple-transition-normal: 0.25s ease;
  --apple-transition-slow: 0.35s ease;
}

/* 重置和基础样式 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  background-color: var(--apple-gray-1);
  color: var(--apple-gray-9);
}

body {
  overflow-x: hidden;
}

#root {
  width: 100%;
  min-height: 100vh;
}

/* 链接样式 */
a {
  color: var(--apple-blue);
  text-decoration: none;
  transition: color var(--apple-transition-fast);
}

a:hover {
  color: #0051d5;
  text-decoration: underline;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--apple-gray-9);
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

/* 按钮基础样式 */
button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--apple-radius-full);
  cursor: pointer;
  transition: all var(--apple-transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 主按钮 */
button.primary {
  background-color: var(--apple-blue);
  color: white;
}

button.primary:hover:not(:disabled) {
  background-color: #0062cc;
  transform: translateY(-1px);
  box-shadow: var(--apple-shadow-medium);
}

/* 次要按钮 */
button.secondary {
  background-color: var(--apple-gray-2);
  color: var(--apple-gray-9);
}

button.secondary:hover:not(:disabled) {
  background-color: var(--apple-gray-3);
}

/* 卡片样式 */
.card {
  background-color: var(--apple-white);
  border-radius: var(--apple-radius-large);
  box-shadow: var(--apple-shadow-small);
  padding: 1.5rem;
  transition: box-shadow var(--apple-transition-normal);
}

.card:hover {
  box-shadow: var(--apple-shadow-medium);
}

/* 输入框样式 */
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--apple-gray-3);
  border-radius: var(--apple-radius-medium);
  background-color: var(--apple-white);
  color: var(--apple-gray-9);
  transition: all var(--apple-transition-normal);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--apple-radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  background-color: var(--apple-gray-2);
  color: var(--apple-gray-8);
}

/* 分隔线 */
.divider {
  height: 1px;
  background-color: var(--apple-gray-2);
  margin: 1.5rem 0;
}

/* 列表样式 */
ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* 滚动条样式 - 苹果风格 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--apple-gray-1);
}

::-webkit-scrollbar-thumb {
  background: var(--apple-gray-4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--apple-gray-5);
}

/* 工具提示样式 */
.tooltip {
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: var(--apple-radius-medium);
  font-size: 0.875rem;
  pointer-events: none;
  z-index: 1000;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn var(--apple-transition-slow) ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  .card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  button {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
}
